home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / c_faq / diff < prev    next >
Text File  |  1994-03-03  |  43KB  |  1,052 lines

  1. Newsgroups: comp.lang.c,comp.answers,news.answers
  2. Path: bloom-beacon.mit.edu!hookup!news.kei.com!MathWorks.Com!panix!ddsw1!uunet!nwnexus!oneworld!eskimo!scs
  3. From: scs@eskimo.com (Steve Summit)
  4. Subject: comp.lang.c Changes to Answers to Frequently Asked Questions (FAQ)
  5. Message-ID: <1994Mar02.0102.scs.0001@eskimo.com>
  6. Followup-To: poster
  7. Sender: scs@eskimo.com (Steve Summit)
  8. Reply-To: scs@eskimo.com
  9. X-Archive-Name: C-faq/diff
  10. Organization: none, at the moment
  11. Date: Wed, 2 Mar 1994 09:02:32 GMT
  12. Approved: news-answers-request@MIT.Edu
  13. Lines: 1036
  14. Xref: bloom-beacon.mit.edu comp.lang.c:34952 comp.answers:4019 news.answers:15995
  15.  
  16. Archive-name: C-faq/diff
  17. Comp-lang-c-archive-name: C-FAQ-list.diff
  18.  
  19. Descending upon your newsfeed like so many lead balloons is an
  20. unaccountably major set of updates to the comp.lang.c FAQ list.
  21. This diff list is about 40K, considerably bigger than the entire
  22. abridged list.  If you appreciate these changes and additions and
  23. are feeling frivolous, drop a note to summit@ocean.washington.edu
  24. and let Melanie (the FAQ list widow) know that my zombie-like
  25. state over the past few days (a *lot* of suggestions and ideas
  26. had accumulated) was not completely without redeeming value. :-)
  27.  
  28. I am experimenting with a table of contents (i.e. a separate list
  29. of the questions only), which many people have been requesting.
  30. It's nearly 20K by itself (and that's the text from the abridged
  31. questions), so I'm posting it as a separate article.  Let me know
  32. if it's useful or how it could be made more useful.
  33.  
  34. Two of the apparently new questions (17.27 and 17.28) may seem
  35. familiar to those of you with long memories.  I had elided them
  36. at one point, in a vain attempt to hold the list to some
  37. reasonable size, but since that's now clearly a lost cause, I
  38. might as well re-enable them.  (The sentence claiming that "Older
  39. copies are obsolete and don't contain much, except the occasional
  40. typo, that the current list doesn't" now becomes true again.)
  41.  
  42. I have one important caution for those of you who are in the
  43. habit of posting or mailing pointers to this FAQ list: many of
  44. the questions have been renumbered, so it would be a good idea
  45. not to refer to questions solely by number for at least a few
  46. months.  (The section numbers, however, remain the same.)
  47.  
  48. (The following context diffs are edited for readability and are
  49. not suitable for use with patch programs.)
  50.  
  51. ==========
  52. < [Last modified November 3, 1993 by scs.]
  53. ---
  54. > [Last modified March 1, 1994 by scs.]
  55. ==========
  56. >     The old HP 3000 series computers use a different addressing
  57. >     scheme for byte addresses than for word addresses; void and char
  58. >     pointers therefore have a different representation than an int
  59. >     (structure, etc.) pointer to the same address would have.
  60. ==========
  61. <     Due to the "equivalence of arrays and pointers" (see question
  62. <     2.3), arrays and pointers often seem interchangeable, and in
  63. ---
  64. >     Due to the so-called equivalence of arrays and pointers (see
  65. >     question 2.3), arrays and pointers often seem interchangeable,
  66. ==========
  67.   2.11:    How do I write functions which accept 2-dimensional arrays when
  68.     the "width" is not known at compile time?
  69. ...
  70. >     gcc allows local arrays to be declared having sizes which are
  71. >     specified by a function's arguments, but this is a nonstandard
  72. >     extension.
  73. ==========
  74. > 2.13:    Since array references decay to pointers, given
  75. >
  76. >         int array[NROWS][NCOLUMNS];
  77. >
  78. >     what's the difference between array and &array?
  79. >
  80. > A:    Under ANSI/ISO Standard C, &array yields a pointer, of type
  81. >     pointer-to-array-of-T, to the entire array (see also question
  82. >     2.12).  Under pre-ANSI C, the & in &array generally elicited a
  83. >     warning, and was generally ignored.  Under all C compilers, an
  84. >     unadorned reference to an array yields a pointer, of type
  85. >     pointer-to-T, to the array's first element.  (See also question
  86. >     2.3.)
  87. ==========
  88.   2.15:    How can I use statically- and dynamically-allocated
  89.     multidimensional arrays interchangeably when passing them to
  90.     functions?
  91.  
  92. < A:    There is no single perfect method.  Given the array and f() as
  93. <     declared in question 2.10, f2() as declared in question 2.11,
  94. <     array1, array2, array3, and array4 as declared in 2.13, and a
  95. ---
  96. > A:    There is no single perfect method.  Given a function f1()
  97. >     similar to the f() of question 2.10, the array as declared in
  98. >     question 2.10, f2() as declared in question 2.11, array1,
  99. >     array2, array3, and array4 as declared in question 2.14, and a
  100. ==========
  101. <         f(array, NROWS, NCOLUMNS);
  102. <         f(array4, nrows, NCOLUMNS);
  103. ---
  104. >         f1(array, NROWS, NCOLUMNS);
  105. >         f1(array4, nrows, NCOLUMNS);
  106. ==========
  107. <         f((int (*)[NCOLUMNS])(*array2), nrows, ncolumns);
  108. <         f((int (*)[NCOLUMNS])array3, nrows, ncolumns);
  109. ---
  110. >         f1((int (*)[NCOLUMNS])(*array2), nrows, ncolumns);
  111. >         f1((int (*)[NCOLUMNS])array3, nrows, ncolumns);
  112. ==========
  113. <     It must again be noted that passing array to f2() is not
  114. ---
  115. >     It must again be noted that passing &array[0][0] to f2() is not
  116.     strictly conforming; see question 2.11.
  117. ==========
  118.   2.16:    Here's a neat trick: if I write
  119.  
  120.         int realarray[10];
  121.         int *array = &realarray[-1];
  122.  
  123.     I can treat "array" as if it were a 1-based array.
  124.  
  125. < A:    Although this technique is attractive (and is used in the book
  126. <     Numerical Recipes in C), it does not conform to the C standards.
  127. ---
  128. > A:    Although this technique is attractive (and was used in old
  129. >     editions of the book Numerical Recipes in C), it does not
  130. ==========
  131. > 2.19:    Can I use a void ** pointer to pass a generic pointer to a
  132. >     function by reference?
  133. >
  134. > A:    Not portably.  There is no generic pointer-to-pointer type in C.
  135. >     void * acts as a generic pointer only because conversions are
  136. >     applied automatically when other pointer types are assigned to
  137. >     and from void *'s; these conversions cannot be performed (the
  138. >     correct underlying pointer type is not known) if an attempt is
  139. >     made to indirect upon a void ** value which points at something
  140. >     other than a void *.
  141. ==========
  142.         char answer[100], *p;
  143.         printf("Type something:\n");
  144. <         fgets(answer, 100, stdin);
  145. ---
  146. >         fgets(answer, sizeof(answer), stdin);
  147. ==========
  148.     Note that this example also uses fgets instead of gets (always a
  149. <     good idea; see question 11.5), so that the size of the array can
  150. <     be specified, so that fgets will not overwrite the end of the
  151. <     array if the user types an overly-long line.  (Unfortunately for
  152. ---
  153. >     good idea; see question 11.5), allowing the size of the array to
  154. >     be specified, so that the end of the array will not be
  155. >     overwritten if the user types an overly-long line.
  156. ==========
  157. <     \n, as gets would.)  It would also be possible to use malloc to
  158. <     allocate the answer buffer, and/or to parameterize its size
  159. <     (#define ANSWERSIZE 100).
  160. ---
  161. >     delete the trailing \n, as gets would.)  It would also be
  162. >     possible to use malloc to allocate the answer buffer.
  163. ==========
  164.   A:    Make sure that the memory to which the function returns a
  165.     pointer is correctly allocated.  The returned pointer should be
  166.     to a statically-allocated buffer, or to a buffer passed in by
  167. <     the caller, but _not_ to a local array.  See also question 17.3.
  168. ---
  169. >     the caller, but _not_ to a local (auto) array.  In other words,
  170. >     never do something like
  171. >
  172. >         char *f()
  173. >         {
  174. >             char buf[10];
  175. >             /* ... */
  176. >             return buf;
  177. >         }
  178. >
  179. >     One fix would to to declare the buffer as
  180. >
  181. >             static char buf[10];
  182. >
  183. >     See also question 17.5.
  184. ==========
  185. > 3.5:    Why does some code carefully cast the values returned by malloc
  186. >     to the pointer type being allocated?
  187. >
  188. > A:    Before ANSI/ISO Standard C introduced the void * generic pointer
  189. >     type, these casts were typically required to silence warnings
  190. >     about assignment between incompatible pointer types.
  191. ==========
  192.   3.6:    You can't use dynamically-allocated memory after you free it,
  193.     can you?
  194.  
  195. < A:    No.  Some early man pages for malloc stated that the contents of
  196. ---
  197. > A:    No.  Some early documentation for malloc stated that the
  198.       contents of freed memory was "left undisturbed;" this ill-
  199.       advised guarantee was never universal and is not required by
  200. ==========
  201. > 3.11:    Must I free allocated memory before the program exits?
  202. >
  203. > A:    You shouldn't have to.  A real operating system definitively
  204. >     reclaims all memory when a program exits.  Nevertheless, some
  205. >     personal computers are said not to reliably recover memory, and
  206. >     all that can be inferred from the ANSI/ISO C Standard is that it
  207. >     is a "quality of implementation issue."
  208. >
  209. >     References: ANSI Sec. 4.10.3.2 .
  210. ==========
  211.   4.1:    Why doesn't this code:
  212.  
  213.         a[i] = i++;
  214.  
  215.     work?
  216.  
  217.   A:    The subexpression i++ causes a side effect -- it modifies i's
  218.     value -- which leads to undefined behavior if i is also
  219. <     referenced elsewhere in the same expression.
  220. ---
  221. >     referenced elsewhere in the same expression.  (Note that
  222. >     although the language in K&R suggests that the behavior of this
  223. >     expression is unspecified, the ANSI/ISO C Standard makes the
  224. >     stronger statement that it is undefined -- see question 5.23.)
  225. ==========
  226. > 4.3:    I've experimented with the code
  227. >
  228. >         int i = 2;
  229. >         i = i++;
  230. >
  231. >     on several compilers.  Some gave i the value 2, some gave 3, but
  232. >     one gave 4.  I know the behavior is undefined, but how could it
  233. >     give 4?
  234. >
  235. > A:    Undefined behavior means _anything_ can happen.  See question
  236. >     5.23.
  237. ==========
  238. > 4.4:    People keep saying the behavior is undefined, but I just tried
  239. >     it on an ANSI-conforming compiler, and got the results I
  240. >     expected.
  241. >
  242. > A:    A compiler may do anything it likes when faced with undefined
  243. >     behavior (and, within limits, with implementation-defined and
  244. >     unspecified behavior), including doing what you expect.  It's
  245. >     unwise to depend on it, though.  See also question 5.18.
  246. ==========
  247. > 4.5:    Can I use explicit parentheses to force the order of evaluation
  248. >     I want?  Even if I don't, doesn't precedence dictate it?
  249. >
  250. > A:    Operator precedence and explicit parentheses impose only a
  251. >     partial ordering on the evaluation of an expression.  Consider
  252. >     the expression
  253. >
  254. >         f() + g() * h()
  255. >
  256. >     -- although we know that the multiplication will happen before
  257. >     the addition, there is no telling which of the three functions
  258. >     will be called first.
  259. ==========
  260.   4.6:    But what about the &&, ||, and comma operators?
  261.     I see code like "if((c = getchar()) == EOF || c == '\n')" ...
  262.  
  263.   A:    There is a special exception for those operators, (as well as
  264. ==========
  265.   5.2:    How can I get a copy of the Standard?
  266.  
  267. < A:    ANSI X3.159 has been officially superseded by ISO 9899.
  268. <     Copies are available from
  269. ---
  270. > A:    ANSI X3.159 has been officially superseded by ISO 9899.  Copies
  271. >     are available in the United States from
  272. ==========
  273. >     In other countries, contact the appropriate national standards
  274. >     body, or ISO in Geneva at:
  275. >
  276. >         ISO Sales
  277. >         Case Postale 56
  278. >         CH-1211 Geneve 20
  279. >         Switzerland
  280. ==========
  281. >     The mistitled _Annotated ANSI C Standard_, with annotations by
  282. >     Herbert Schildt, contains the full text of ISO 9899; it is
  283. >     published by Osborne/McGraw-Hill, ISBN 0-07-881952-0, and sells
  284. >     in the U.S. for approximately $40.  (It has been suggested that
  285. >     the price differential between this work and the official
  286. >     standard reflects the value of the annotations.)
  287. ==========
  288.   A:    Two programs, protoize and unprotoize, convert back and forth
  289.     between prototyped and "old style" function definitions and
  290.     declarations.  (These programs do _not_ handle full-blown
  291.     translation between "Classic" C and ANSI C.)  These programs
  292. <     exist as patches to the FSF GNU C compiler, gcc.  Look for the
  293. <     file protoize-1.39.0.5.Z in pub/gnu at prep.ai.mit.edu
  294. <     (18.71.0.38), or at several other FSF archive sites.
  295. ---
  296. >     were once patches to the FSF GNU C compiler, gcc, but are now
  297. >     part of the main gcc distribution; look in pub/gnu at
  298. >     prep.ai.mit.edu (18.71.0.38), or at several other FSF archive
  299. >     sites.
  300. ==========
  301. <     The unproto program (/pub/unix/unproto4.shar.Z on
  302. ---
  303. >     The unproto program (/pub/unix/unproto5.shar.Z on
  304.     ftp.win.tue.nl) is a filter which sits between the preprocessor
  305.     and the next compiler pass, converting most of ANSI C to
  306.     traditional C on-the-fly.
  307. ==========
  308.     Several prototype generators exist, many as modifications to
  309.     lint.  Version 3 of CPROTO was posted to comp.sources.misc in
  310. <     March, 1992.  See also question 17.8.
  311. ---
  312. >     March, 1992.  There is another program called "cextract."  See
  313. >     also question 17.12.
  314. ==========
  315. > 5.5:    I don't understand why I can't use const values in initializers
  316. >     and array dimensions, as in
  317. >
  318. >         const int n = 5;
  319. >         int a[n];
  320. >
  321. > A:    The const qualifier really means "read-only;" an object so
  322. >     qualified is a normal run-time object which cannot (normally) be
  323. >     assigned to.  The value of a const-qualified object is therefore
  324. >     _not_ a constant expression in the full sense of the term.  (C
  325. >     is unlike C++ in this regard.)  When you need a true compile-
  326. >     time constant, use a preprocessor #define.
  327. >
  328. >     References: ANSI Sec. 3.4 .
  329. ==========
  330.   A:    You have mixed the new-style prototype declaration
  331.     "extern int func(float);" with the old-style definition
  332. <     "int func(x) float x;".  Old C (and ANSI C, in the absence of
  333. <     prototypes, and in variable-length argument lists) "widens"
  334. <     certain arguments when they are passed to functions.  floats are
  335. <     promoted to double, and characters and short integers are
  336. <     promoted to ints.  (The values are automatically converted back
  337. ---
  338. >     "int func(x) float x;".  It is usually safe to mix the two
  339. >     styles (see question 5.9), but not in this case.  Old C (and
  340. >     ANSI C, in the absence of prototypes, and in variable-length
  341. >     argument lists) "widens" certain arguments when they are passed
  342. >     to functions.  floats are promoted to double, and characters and
  343. >     short integers are promoted to ints.  (For old-style function
  344. >     definitions, the values are automatically converted back to the
  345. >     corresponding narrower types within the body of the called
  346. >     function, if they are declared that way there.)
  347. ==========
  348. > 5.9:    Can you mix old-style and new-style function syntax?
  349. >
  350. > A:    Doing so is perfectly legal, as long as you're careful (see
  351. >     especially question 5.8).  Note however that old-style syntax is
  352. >     marked as obsolescent, and support for it may be removed some
  353. >     day.
  354. >
  355. >     References: ANSI Secs. 3.7.1, 3.9.5 .
  356. ==========
  357. >     Declaring a function as void does not merely silence warnings;
  358. >     it may also result in a different function call/return sequence,
  359. >     incompatible with what the caller (in main's case, the C run-
  360. >     time startup code) expects.
  361. ==========
  362. > 5.17:    Why are some ANSI/ISO Standard library routines showing up as
  363. >     undefined, even though I've got an ANSI compiler?
  364. >
  365. > A:    It's not unusual to have a compiler available which accepts ANSI
  366. >     syntax, but not to have ANSI-compatible header files or run-time
  367. >     libraries installed.  See also questions 5.16 and 17.2.
  368. ==========
  369. > 5.19:    Why can't I perform arithmetic on a void * pointer?
  370. >
  371. > A:    The compiler doesn't know the size of the pointed-to objects.
  372. >     Before performing arithmetic, cast the pointer either to char *
  373. >     or to the type you're trying to manipulate.
  374. ==========
  375.   5.20:    Is char a[3] = "abc"; legal?  What does it mean?
  376.  
  377. < A:    It is legal, though questionably useful.  It declares an array
  378. ---
  379. > A:    It is legal in ANSI C (and perhaps in a few pre-ANSI systems),
  380.     though questionably useful.  It declares an array of size three,
  381.     initialized with the three characters 'a', 'b', and 'c', without
  382.     the usual terminating '\0' character; the array is therefore not
  383.     a true C string and cannot be used with strcpy, printf %s, etc.
  384. ==========
  385. > 5.22:    What does #pragma once mean?  I found it in some header files.
  386. >
  387. > A:    It is an extension implemented by some preprocessors to help
  388. >     make header files idempotent; it is essentially equivalent to
  389. >     the #ifndef trick mentioned in question 6.4.
  390. ==========
  391. > 5.23:    People seem to make a point of distinguishing between
  392. >     implementation-defined, unspecified, and undefined behavior.
  393. >     What's the difference?
  394. >
  395. > A:    Briefly: implementation-defined means that an implementation
  396. >     must choose some behavior and document it.  Unspecified means
  397. >     that an implementation should choose some behavior, but need not
  398. >     document it.  Undefined means that absolutely anything might
  399. >     happen.  In no case does the Standard impose requirements; in
  400. >     the first two cases it occasionally suggests (and may require a
  401. >     choice from among) a small set of likely behaviors.
  402. >
  403. >     If you're interested in writing portable code, you can ignore
  404. >     the distinctions, as you'll want to avoid code that depends on
  405. >     any of the three behaviors.
  406. >
  407. >     References: ANSI Sec. 1.6, especially the Rationale.
  408. ==========
  409.   6.8:    I inherited some code which contains far too many #ifdef's for
  410.     my taste.  How can I preprocess the code to leave only one
  411.     conditional compilation set, without running it through cpp and
  412.     expanding all of the #include's and #define's as well?
  413.  
  414. < A:    There is a program floating around called unifdef which does
  415. ---
  416. > A:    There are programs floating around called unifdef, rmifdef, and
  417. >     scpp which do exactly this.  (See question 17.12.)
  418. ==========
  419.   A:    One popular trick is to define the macro with a single argument,
  420.     and call it with a double set of parentheses, which appear to
  421.     the preprocessor to indicate a single argument:
  422.  
  423.         #define DEBUG(args) (printf("DEBUG: "), printf args)
  424.  
  425.         if(n != 0) DEBUG(("n is %d\n", n));
  426.  
  427.     The obvious disadvantage is that the caller must always remember
  428. <     to use the extra parentheses.  Another solution is to use
  429.     different macros (DEBUG1, DEBUG2, etc.) depending on the number
  430. <     of arguments.  (It is often better to use a bona-fide function,
  431. <     which can take a variable number of arguments in a well-defined
  432. <     way.  See questions 7.1 and 7.2 below.)
  433. ---
  434.     The obvious disadvantage is that the caller must always remember
  435. >     to use the extra parentheses.  Other solutions are to use
  436.     different macros (DEBUG1, DEBUG2, etc.) depending on the number
  437. >     of arguments, or to play games with commas:
  438. >
  439. >         #define DEBUG(args) (printf("DEBUG: "), printf(args))
  440. >         #define _ ,
  441. >         DEBUG("i = %d" _ i)
  442. >
  443. >     It is often better to use a bona-fide function, which can take a
  444. >     variable number of arguments in a well-defined way.  See
  445. >     questions 7.1 and 7.2.
  446. ==========
  447.   A:    This information is not available to a portable program.  Some
  448.     old systems provided a nonstandard nargs() function, but its use
  449.     was always questionable, since it typically returned the number
  450. <     of words passed, not the number of arguments.  (Floating point
  451. <     values and structures are usually passed as several words.)
  452. ---
  453. >     of words passed, not the number of arguments.  (Structures and
  454. >     floating point values are usually passed as several words.)
  455. ==========
  456. > 9.6:    How can I read/write structs from/to data files?
  457. >
  458. > A:    It is relatively straightforward to write a struct out using
  459. >     fwrite:
  460. >
  461. >         fwrite((char *)&somestruct, sizeof(somestruct), 1, fp);
  462. >
  463. >     and a corresponding fread invocation can read it back in.
  464. >     However, data files so written will _not_ be very portable (see
  465. >     questions 9.11 and 17.3).  Note also that on many systems you
  466. >     must use the "b" flag when fopening the files.
  467. ==========
  468.   9.7:    I came across some code that declared a structure like this:
  469.  
  470.         struct name
  471.             {
  472.             int namelen;
  473.             char name[1];
  474.             };
  475.  
  476.     and then did some tricky allocation to make the name array act
  477.     like it had several elements.  Is this legal and/or portable?
  478.  
  479.   A:    This technique is popular, although Dennis Ritchie has called it
  480. <     "unwarranted chumminess with the compiler."  An ANSI
  481. <     Interpretation Ruling has deemed it not strictly conforming.  It
  482. ---
  483.   A:    This technique is popular, although Dennis Ritchie has called it
  484. >     "unwarranted chumminess with the C implementation."  An ANSI
  485. >     Interpretation Ruling has deemed it (more precisely, access
  486. >     beyond the declared size of the name field) to be not strictly
  487. >     conforming, although a thorough treatment of the arguments
  488. >     surrounding the legality of the technique is beyond the scope of
  489. >     this list.  It seems, however, to be portable to all known
  490.      implementations.  (Compilers which check array bounds carefully
  491.      might issue warnings.)
  492. >
  493. >     To be on the safe side, it may be preferable to declare the
  494. >     variable-size element very large, rather than very small; in the
  495. >     case of the above example:
  496. >
  497. >         ...
  498. >         char name[MAXSIZE];
  499. >         ...
  500. >
  501. >     where MAXSIZE is larger than any name which will be stored.
  502. >     (The trick so modified is said to be in conformance with the
  503. >     Standard.)
  504. >
  505.     References: ANSI Rationale Sec. 3.5.4.2 pp. 54-5.
  506. ==========
  507. > 9.13:    How can I pass constant values to routines which accept struct
  508. >     arguments?
  509. >
  510. > A:    C has no way of generating anonymous struct values.  You will
  511. >     have to use a temporary struct variable.
  512. ==========
  513.   A:    Some vendors of C products for 64-bit machines support 64-bit
  514.     long ints.  Others fear that too much existing code depends on
  515.     sizeof(int) == sizeof(long) == 32 bits, and introduce a new 64-
  516. <     bit long long int type instead.
  517. ---
  518. >     bit long long (or __longlong) type instead.
  519. ==========
  520. <     Vendors who feel compelled to introduce a new long long int type
  521. ---
  522. >     Vendors who feel compelled to introduce a new, longer integral
  523.     type should advertise it as being "at least 64 bits" (which is
  524.     truly new; a type traditional C doesn't have), and not "exactly
  525.     64 bits."
  526. ==========
  527. > 10.6:    My compiler is complaining about an invalid redeclaration of a
  528. >     function, but I only define it once and call it once.
  529. >
  530. > A:    If the first call precedes the definition, the compiler will
  531. >     assume a function returns an int.  Non-int functions must be
  532. >     declared before they are called.
  533. >
  534. >     References: K&R I Sec. 4.2 pp. 70; K&R II Sec. 4.2 p. 72; ANSI
  535. >     Sec. 3.3.2.2 .
  536. ==========
  537. > 10.8:    What does extern mean in a function declaration?
  538. >
  539. > A:    It can be used as a stylistic hint to indicate that the
  540. >     function's definition is probably in another source file, but
  541. >     there is no formal difference between
  542. >
  543. >         extern int f();
  544. >     and
  545. >         int f();
  546. >
  547. >     References: ANSI Sec. 3.1.2.2 .
  548. ==========
  549. > 10.11: What's the auto keyword good for?
  550. >
  551. > A:    Nothing; it's obsolete.
  552. ==========
  553.   11.2:    Why doesn't the code scanf("%d", i); work?
  554.  
  555. < A:    You must always pass addresses (in this case, &i) to scanf.
  556. ---
  557. > A:    scanf needs pointers to the variables it is to fill in; you must
  558. >     call scanf("%d", &i);
  559. ==========
  560.   11.3:    Why doesn't this code:
  561.  
  562.         double d;
  563.         scanf("%f", &d);
  564.  
  565.     work?
  566.  
  567. < A:    With scanf, use %lf for values of type double, and %f for float.
  568. ---
  569. > A:    scanf uses %lf for values of type double, and %f for float.
  570.     (Note the discrepancy with printf, which uses %f for both double
  571.     and float, due to C's default argument promotion rules.)
  572. ==========
  573.   11.5:    Why does everyone say not to use gets()?
  574.  
  575.   A:    It cannot be told the size of the buffer it's to read into, so
  576. <     it cannot be prevented from overflowing that buffer.
  577. ---
  578. >     it cannot be prevented from overflowing that buffer.  See
  579. >     question 3.1 for a code fragment illustrating the replacement of
  580. >     gets() with fgets().
  581. ==========
  582.   12.2:    I'm trying to sort an array of strings with qsort, using strcmp
  583.     as the comparison function, but it's not working.
  584.  
  585. A:    By "array of strings" you probably mean "array of pointers to
  586.     char."  The arguments to qsort's comparison function are
  587.     pointers to the objects being sorted, in this case, pointers to
  588.     pointers to char.  (strcmp, of course, accepts simple pointers
  589.     to char.)
  590. ...
  591. >     Beware of the discussion in K&R II Sec. 5.11 pp. 119-20, which
  592. >     is not discussing Standard library qsort.
  593. ==========
  594.   12.3:    Now I'm trying to sort an array of structures with qsort.  My
  595.     comparison routine takes pointers to structures, but the
  596.     compiler complains that the function is of the wrong type for
  597.     qsort.  How can I cast the function pointer to shut off the
  598.     warning?
  599.  
  600.   A:    The conversions must be in the comparison function, which must
  601.     be declared as accepting "generic pointers" (const void * or
  602. >     char *) as discussed in question 12.2 above.  The code might
  603. >     look like
  604. >
  605. >         int mystructcmp(p1, p2)
  606. >         char *p1, *p2;        /* const void * for ANSI C */
  607. >         {
  608. >             struct mystruct *sp1 = (struct mystruct *)p1;
  609. >             struct mystruct *sp2 = (struct mystruct *)p2;
  610. >             /* now compare sp1->whatever and *sp2-> ... */
  611. >         }
  612. >
  613. >     (If, on the other hand, you're sorting pointers to structures,
  614. >     you'll need indirection, as in question 12.2:
  615. >     sp1 = *(struct mystruct **)p1 .)
  616. ==========
  617.     Converting a string to a time_t is harder, because of the wide
  618. <     variety of date and time formats which should be parsed.
  619. <     Public-domain routines have been written for performing this
  620. <     function (see, for example, the file partime.c, widely
  621. <     distributed with the RCS package), but they are less likely to
  622. <     become standardized.
  623. ---
  624. >     variety of date and time formats which should be parsed.  Some
  625. >     systems provide a strptime function; another popular routine is
  626. >     partime (widely distributed with the RCS package), but these are
  627. >     less likely to become standardized.
  628. ==========
  629. > 12.7:    How can I add n days to a date?  How can I find the difference
  630. >     between two dates?
  631. >
  632. > A:    The ANSI/ISO Standard C mktime and difftime functions provide
  633. >     support for both problems.  mktime accepts non-normalized dates,
  634. >     so it is straightforward to take a filled in struct tm, add or
  635. >     subtract from the tm_mday field, and call mktime to normalize
  636. >     the year, month, and day fields (and convert to a time_t value).
  637. >     difftime computes the difference, in seconds, between two time_t
  638. >     values; mktime can be used to compute time_t values for two
  639. >     dates to be subtracted.  (Note, however, that these solutions
  640. >     only work for dates which can be represented as time_t's.)  See
  641. >     also questions 12.6 and 17.28.
  642. >
  643. >     References: K&R II Sec. B10 p. 256; H&S Secs. 20.4, 20.5
  644. >     pp. 361-362; ANSI Secs. 4.12.2.2, 4.12.2.3 .
  645. ==========
  646. > 12.9:    How can I get random integers in a certain range?
  647. >
  648. > A:    The obvious way,
  649. >
  650. >         rand() % N
  651. >
  652. >     (where N is of course the range) is poor, because the low-order
  653. >     bits of many random number generators are distressingly non-
  654. >     random.  (See question 12.11.)  A better method is something
  655. >     like
  656. >
  657. >         (int)((double)rand() / ((double)RAND_MAX + 1) * N)
  658. >
  659. >     If you're worried about using floating point, you could try
  660. >
  661. >         rand() / (RAND_MAX / N + 1)
  662. >
  663. >     Both methods obviously require knowing RAND_MAX (which ANSI
  664. >     defines in <stdlib.h>), and assume that N is much less than
  665. >     RAND_MAX.
  666. ==========
  667. > 12.13: I keep getting errors due to library routines being undefined,
  668. >     but I'm #including all the right header files.
  669. >
  670. > A:    In some cases (especially if the routines are nonstandard) you
  671. >     may have to explicitly ask for the correct libraries to be
  672. >     searched when you link the program.  See also question 15.2.
  673. ==========
  674. > 12.14: I'm still getting errors due to library routines being
  675. >     undefined, even though I'm using -l to request the libraries
  676. >     while linking.
  677. >
  678. > A:    Many linkers make one pass over the list of object files and
  679. >     libraries you specify, and extract from libraries only those
  680. >     modules which satisfy references which have so far come up as
  681. >     undefined.  Therefore, the order in which libraries are listed
  682. >     with respect to object files (and each other) is significant;
  683. >     usually, you want to search the libraries last (i.e., under
  684. >     Unix, put any -l switches towards the end of the command line).
  685. ==========
  686. > 12.15: I need some code to do regular expression matching.
  687. >
  688. > A:    Look for the regexp library (supplied with many Unix systems),
  689. >     or get Henry Spencer's regexp package from cs.toronto.edu in
  690. >     pub/regexp.shar.Z (see also question 17.12).
  691. ==========
  692. > 12.16: How can I split up a command line into argc and argv, like the
  693. >     shell does?
  694. >
  695. > A:    Most systems have a routine called strtok.
  696. >
  697. >     References: ANSI Sec. 4.11.5.8; K&R II Sec. B3 p. 250; H&S
  698. >     Sec. 15.7; PCS p. 178.
  699. ==========
  700.   15.2:    I'm trying to do some simple trig, and I am #including <math.h>,
  701.     but I keep getting "undefined: _sin" compilation errors.
  702.  
  703. < A:    Make sure you're linking against the correct math library.  For
  704. ---
  705. > A:    Make sure you're linking with the correct math library.  For
  706. ==========
  707. > 15.4:    How do I round numbers?
  708. >
  709. > A:    The simplest and most straightforward way is with code like
  710. >
  711. >         (int)(x + 0.5)
  712. >
  713. >     This won't work properly for negative numbers, though.
  714. ==========
  715. > 15.5:    How do I test for IEEE NaN and other special values?
  716. >
  717. > A:    Many systems with high-quality IEEE floating-point
  718. >     implementations provide facilities (e.g. an isnan() macro) to
  719. >     deal with these values cleanly, and the Numerical C Extensions
  720. >     Group (NCEG) is working to formally standardize such facilities.
  721. >     A crude but usually effective test for NaN is exemplified by
  722. >
  723. >         #define isnan(x) ((x) != (x))
  724. >
  725. >     although non-IEEE-aware compilers may optimize the test away.
  726. ==========
  727.   A:    Contrary to popular belief and many people's wishes, this is not
  728.     a C-related question.  (Nor are closely-related questions
  729.     concerning the echo of keyboard input.)  The delivery of
  730.     characters from a "keyboard" to a C program is a function of the
  731.     operating system in use, and has not been standardized by the C
  732.     language.  Some versions of curses have a cbreak() function
  733. <     which does what you want.  Under UNIX, use ioctl to play with
  734. <     the terminal driver modes (CBREAK or RAW under "classic"
  735. <     versions; ICANON, c_cc[VMIN] and c_cc[VTIME] under System V or
  736. <     Posix systems).  Under MS-DOS, use getch().  Under VMS, try the
  737. <     Screen Management (SMG$) routines, or curses, or issue low-level
  738. <     $QIO's to ask for one character at a time.  Under other
  739. ---
  740. >     which does what you want.  If you're specifically trying to read
  741. >     a short password without echo, you might try getpass().  Under
  742. >     Unix, use ioctl to play with the terminal driver modes (CBREAK
  743. >     or RAW under "classic" versions; ICANON, c_cc[VMIN] and
  744. >     c_cc[VTIME] under System V or Posix systems).  Under MS-DOS, use
  745. >     getch().  Under VMS, try the Screen Management (SMG$) routines,
  746. >     or curses, or issue low-level $QIO's with the IO$_READVBLK (and
  747. >     perhaps IO$M_NOECHO) function codes to ask for one character at
  748. >     a time.  Under other operating systems, you're on your own.
  749. ==========
  750. > 16.7:    How can I check whether a file exists?  I want to query the user
  751. >     if a requested output file already exists.
  752. >
  753. > A:    You can try the access() routine, although it's got a few
  754. >     problems.  (It isn't atomic with respect to the following
  755. >     action, and it has anomalies if the program calling it is
  756. >     running as root.)
  757. ==========
  758.   16.8:    How can I find out the size of a file, prior to reading it in?
  759. ...
  760. >     files).  Some systems provide routines called filesize or
  761. >     filelength.
  762. ==========
  763. > 16.12: How can I invoke an operating system command from within a
  764. >     program?
  765. >
  766. > A:    Use system().
  767. >
  768. >     References: K&R II Sec. B6 p. 253; ANSI Sec. 4.10.4.5; H&S
  769. >     Sec. 21.2; PCS Sec. 11 p. 179;
  770. ==========
  771. > 16.15: How can I do serial ("comm") port I/O?
  772. >
  773. > A:    It's system-dependent.  Under Unix, you typically open, read,
  774. >     and write a device in /dev, and use the facilities of the
  775. >     terminal driver to adjust its characteristics.  Under MS-DOS,
  776. >     you can either use some primitive BIOS interrupts, or (if you
  777. >     require decent performance) one of any number of interrupt-
  778. >     driven serial I/O packages.
  779. ==========
  780.   17.1:    What can I safely assume about the initial values of variables
  781.     which are not explicitly initialized?
  782. ...
  783.   A:    Variables with "static" duration (that is, those declared
  784.     outside of functions, and those declared with the storage class
  785. <     static), are guaranteed initialized to zero, as if the
  786. <     programmer had typed "= 0".  Therefore, such variables are
  787. ---
  788. >     static), are guaranteed initialized (just once, at program
  789. >     startup) to zero, as if the programmer had typed "= 0".
  790. ==========
  791. > 17.2:    This code, straight out of a book, isn't compiling:
  792. >
  793. >         f()
  794. >         {
  795. >         char a[] = "Hello, world!";
  796. >         }
  797. >
  798. > A:    Perhaps you have a pre-ANSI compiler, which doesn't allow
  799. >     initialization of "automatic aggregates" (i.e. non-static local
  800. >     arrays and structures).  As a workaround, you can make the array
  801. >     global or static.  (You can always initialize local char *
  802. >     variables with string literals, but see question 17.20).  See
  803. >     also questions 5.16 and 5.17.
  804. ==========
  805. > 17.4:    How can I delete a line (or record) from the middle of a file?
  806. >
  807. > A:    Short of rewriting the file, you probably can't.  See also
  808. >     question 16.9.
  809. ==========
  810. > 17.10: Is C++ a superset of C?  Can I use a C++ compiler to compile C
  811. >     code?
  812.  
  813. > A:    C++ was derived from C, and is largely based on it, but there
  814. >     are some legal C constructs which are not legal C++.  (Many C
  815. >     programs will nevertheless compile correctly in a C++
  816. >     environment.)
  817. ==========
  818. > 17.11: I need:                        A:  Look for programs (see also
  819. >                         question 17.12) named:
  820. >
  821. >     a C cross-reference                 cflow, calls, cscope
  822. >     generator
  823. >
  824. >     a C beautifier/pretty-              cb, indent
  825. >     printer
  826. ==========
  827.     and/or uucp from a central, public-spirited site, such as uunet
  828.     (ftp.uu.net, 192.48.96.9).  However, this article cannot track
  829.     or list all of the available archive sites and how to access
  830. <     them.  The comp.archives newsgroup contains numerous
  831. ---
  832. >    them.
  833. >
  834. >     Ajay Shah maintains an index of free numerical software; it is
  835. >     posted periodically, and available where this FAQ list is
  836. >     archived (see question 17.33).  The comp.archives newsgroup
  837. ==========
  838. < 17.10: Why don't C comments nest?  Are they legal inside quoted
  839.     strings?
  840. ---
  841. > 17.14: Why don't C comments nest?  How am I supposed to comment out
  842. >     code containing comments?  Are comments legal inside quoted
  843.     strings?
  844.  
  845.   A:    Nested comments would cause more harm than good, mostly because
  846.     of the possibility of accidentally leaving comments unclosed by
  847.     including the characters "/*" within them.  For this reason, it
  848.     is usually better to "comment out" large sections of code, which
  849.     might contain comments, with #ifdef or #if 0 (but see question
  850. ==========
  851. > 17.15: How can I get the ASCII value corresponding to a character, or
  852. >     vice versa?
  853. >
  854. > A:    In C, characters are represented by small integers corresponding
  855. >     to their values (in the machine's character set) so you don't
  856. >     need a conversion routine: if you have the character, you have
  857. >     its value.
  858. ==========
  859. > 17.20: Why does this code:
  860. >
  861. >         char *p = "Hello, world!";
  862. >         p[0] = tolower(p[0]);
  863. >
  864. >     crash?
  865. >
  866. > A:    String literals are not necessarily modifiable, except (in
  867. >     effect) when they are used as array initializers.  Try
  868. >
  869. >         char a[] = "Hello, world!";
  870. >
  871. >     (For compiling old code, some compilers have a switch
  872. >     controlling whether strings are writable or not.)  See also
  873. >     questions 2.1, 2.2, 2.8, and 17.2.
  874. >
  875. >     References: ANSI Sec. 3.1.4 .
  876. ==========
  877.   17.22: What do "Segmentation violation" and "Bus error" mean?
  878.  
  879.   A:    These generally mean that your program tried to access memory it
  880.     shouldn't have, invariably as a result of improper pointer use,
  881. <     often involving malloc (see question 17.17) or perhaps scanf
  882. <     (see question 11.2).
  883. ---
  884. >     often involving uninitialized or improperly allocated pointers
  885. >     (see questions 3.1 and 3.2), or malloc (see question 17.23), or
  886. >     perhaps scanf (see question 11.2).
  887. ==========
  888.     A number of debugging packages exist to help track down malloc
  889. <     problems; one popular one is Conor P. Cahill's "dbmalloc".
  890. ---
  891. >     problems; one popular one is Conor P. Cahill's "dbmalloc,"
  892. >     posted to comp.sources.misc in September of 1992.  Others are
  893. >     "leak," available in volume 27 of the comp.sources.unix
  894. >     archives; JMalloc.c and JMalloc.h in Fidonet's C_ECHO Snippets
  895. >     (or ask archie; see question 17.12); and MEMDEBUG from
  896. >     dorado.crpht.lu in pub/sources/memdebug .  See also question
  897. >     17.12.
  898. ==========
  899.   17.24:    Does anyone have a C compiler test suite I can use?
  900.  
  901. < A:    Plum Hall (1 Spruce Ave., Cardiff, NJ 08232, USA) sells one.
  902. ---
  903. > A:    Plum Hall (formerly in Cardiff, NJ; now in Hawaii) sells one.
  904. ==========
  905. <     compilers.  Kahan's paranoia test, found in netlib on
  906. <     research.att.com, strenuously tests a C implementation's
  907. <     floating point capabilities.
  908. ---
  909. >     compilers.  Kahan's paranoia test, found in netlib/paranoia on
  910. >     netlib.att.com, strenuously tests a C implementation's floating
  911. >     point capabilities.
  912. ==========
  913.  17.25:    Where can I get a YACC grammar for C?
  914.  
  915.   A:    The definitive grammar is of course the one in the ANSI
  916. <     standard.  Several copies are floating around; keep your eyes
  917. <     open.  There is one (due to Jeff Lee) on uunet (see question
  918. <     17.8) in usenet/net.sources/ansi.c.grammar.Z (including a
  919. <     companion lexer).  Another one, by Jim Roskind, is in
  920. <     pub/*grammar* at ics.uci.edu .  The FSF's GNU C compiler
  921. ---
  922.   A:    The definitive grammar is of course the one in the ANSI
  923. >     standard.  Another grammar, by Jim Roskind, is in pub/*grammar*
  924. >     at ics.uci.edu .  A fleshed-out, working instance of the ANSI
  925. >     grammar (due to Jeff Lee) is on uunet (see question 17.12) in
  926. >     usenet/net.sources/ansi.c.grammar.Z (including a companion
  927. >     lexer).  The FSF's GNU C compiler contains a grammar, as does
  928. >     the appendix to K&R II.
  929. ==========
  930. > 17.26: I need code to parse and evaluate expressions.
  931. >
  932. > A:    Two available packages are "defunc," posted to comp.source.misc
  933. >     in December, 1993 (V41 i32,33), to alt.sources in January, 1994,
  934. >     and available from sunsite.unc.edu in
  935. >     pub/packages/development/libraries/defunc-1.3.tar.Z; and
  936. >     "parse," at lamont.ldgo.columbia.edu.
  937. ==========
  938. > 17.27: I need a sort of an "approximate" strcmp routine, for comparing
  939. >     two strings for close, but not necessarily exact, equality.
  940. >
  941. > A:    The traditional routine for doing this sort of thing involves
  942. >     the "soundex" algorithm, which maps similar-sounding words to
  943. >     the same numeric codes.  Soundex is described in the Searching
  944. >     and Sorting volume of Donald Knuth's classic _The Art of
  945. >     Computer Programming_.
  946. ==========
  947. > 17.28: How can I find the day of the week given the date?
  948. >
  949. > A:    Use mktime (see questions 12.6 and 12.7), or Zeller's
  950. >     congruence.  Here is one quick implementation posted by Tomohiko
  951. >     Sakamoto:
  952. >
  953. >         dayofweek(y, m, d)      /* 0 = Sunday */
  954. >         int y, m, d;            /* 1 <= m <= 12,  y > 1752 or so */
  955. >         {
  956. >             static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
  957. >             y -= m < 3;
  958. >             return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;
  959. >         }
  960. ==========
  961. > 17.29: Will 2000 be a leap year?  Is (year % 4 == 0) an accurate test
  962. >     for leap years?
  963. >
  964. > A:    Yes and no, respectively.  The full expression for the Gregorian
  965. >     calendar is
  966. >
  967. >         year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
  968. >
  969. >     See a good astronomical almanac or other reference for details.
  970. ==========
  971. > 17.32: Are there any C tutorials on the net?
  972. >
  973. > A:    There are at least two of them:
  974. >
  975. >     "Notes for C programmers," by Christopher Sawtell,
  976. >     available from:
  977. >     svr-ftp.eng.cam.ac.uk:misc/sawtell_C.shar
  978. >     garbo.uwasa.fi:/pc/c/c-lesson.zip
  979. >     oak.oakland.edu:pub/msdos/c/LEARN-C.ZIP
  980. >     paris7.jussieu.fr:/contributions/docs
  981. >
  982. >     Tim Love's "C for Programmers,"
  983. >     available from svr-ftp.eng.cam.ac.uk in the misc directory.
  984. ==========
  985.  17.33:    Where can I get extra copies of this list?  What about back
  986.     issues?
  987.  
  988.   A:    For now, just pull it off the net; it is normally posted to
  989. <     comp.lang.c on the first of each month, with an Expiration: line
  990. <     which should keep it around all month.  It can also be found in
  991. <     the newsgroups comp.answers and news.answers .  Several sites
  992. <     archive news.answers postings and other FAQ lists, including
  993. <     this one: two sites are rtfm.mit.edu (directory pub/usenet), and
  994. <     ftp.uu.net (directory usenet).  The archie server should help
  995. <     you find others.  See the meta-FAQ list in news.answers for more
  996. <     information; see also question 17.8.
  997. ---
  998.   A:    For now, just pull it off the net; it is normally posted to
  999. >     comp.lang.c on the first of each month, with an Expires: line
  1000. >     which should keep it around all month.  An abridged version is
  1001. >     also available (and posted), as is a list of changes
  1002. >     accompanying each significantly updated version.  These lists
  1003. >     can also be found in the newsgroups comp.answers and
  1004. >     news.answers .  Several sites archive news.answers postings and
  1005. >     other FAQ lists, including this one: two sites are rtfm.mit.edu
  1006. >     (directories pub/usenet/news.answers/C-faq/ and
  1007. >     pub/usenet/comp.lang.c/ ) and ftp.uu.net (directory
  1008. >     usenet/news.answers/C-faq/ ).  The archie server should help you
  1009. >     find others; query it for "prog C-faq".  See the meta-FAQ list
  1010. >     in news.answers for more information; see also question 17.12.
  1011. ==========
  1012.   Acknowledgements
  1013.  
  1014.   Thanks to Jamshid Afshar, Sudheer Apte, Randall Atkinson, Dan Bernstein,
  1015.   Vincent Broman, Stan Brown, Joe Buehler, Gordon Burditt, Burkhard Burow,
  1016. > Conor P. Cahill, D'Arcy J.M. Cain, Christopher Calabrese, Ian Cargill,
  1017. > Paul Carter, Raymond Chen, Jonathan Coxhead, Lee Crawford, Steve Dahmer,
  1018. > Andrew Daviel, James Davies, Jutta Degener, Norm Diamond, Jeff Dunlop,
  1019. > Ray Dunn, Stephen M. Dunn, Michael J. Eager, Dave Eisen, Bjorn Engsig,
  1020. > Chris Flatters, Rod Flores, Alexander Forst, Jeff Francis, Dave
  1021.   Gillespie, Samuel Goldstein, Alasdair Grant, Ron Guilmette, Doug Gwyn,
  1022. > Tony Hansen, Joe Harrington, Guy Harris, Elliotte Rusty Harold, Jos
  1023. > Horsmeier, Blair Houghton, Ke Jin, Kirk Johnson, Larry Jones, Kin-ichi
  1024. > Kitano, Peter Klausler, Andrew Koenig, Tom Koenig, Ajoy Krishnan T,
  1025. > Markus Kuhn, John Lauro, Felix Lee, Mike Lee, Timothy J. Lee, Tony Lee,
  1026. > Don Libes, Christopher Lott, Tim Love, Tim McDaniel, Stuart MacMartin,
  1027. > John R. MacMillan, Bob Makowski, Evan Manning, Barry Margolin, George
  1028. > Matas, Brad Mears, Bill Mitchell, Mark Moraes, Darren Morby, Ken Nakata,
  1029. > Landon Curt Noll, David O'Brien, Richard A. O'Keefe, Hans Olsson, Philip
  1030. > (lijnzaad@embl-heidelberg.de), Christopher Phillips, Francois Pinard,
  1031. > Dan Pop, Kevin D. Quitt, Pat Rankin, J. M. Rosenstock, Erkki Ruohtula,
  1032. > Tomohiko Sakamoto, Rich Salz, Chip Salzenberg, Paul Sand, DaviD
  1033. > W. Sanderson, Christopher Sawtell, Paul Schlyter, Doug Schmidt, Rene
  1034. > Schmit, Patricia Shanahan, Peter da Silva, Joshua Simons, Henry Spencer,
  1035. > David Spuler, Melanie Summit, Erik Talvola, Clarke Thatcher, Wayne
  1036. > Throop, Chris Torek, Andrew Tucker, Goran Uddeborg, Rodrigo Vanegas, Jim
  1037. > Van Zandt, Wietse Venema, Ed Vielmetti, Larry Virden, Chris Volpe, Mark
  1038. > Warren, Larry Weiss, Freek Wiedijk, Lars Wirzenius, Dave Wolverton,
  1039.   Mitch Wright, Conway Yee, and Zhuo Zang, who have contributed, directly
  1040.   or indirectly, to this article.  Special thanks to Karl Heuer, and
  1041.   particularly to Mark Brader, who (to borrow a line from Steve Johnson)
  1042.   have goaded me beyond my inclination, and occasionally beyond my
  1043.   endurance, in relentless pursuit of a better FAQ list.
  1044. ==========
  1045. < This article is Copyright 1988, 1990-1993 by Steve Summit.
  1046. ---
  1047. > This article is Copyright 1988, 1990-1994 by Steve Summit.
  1048. ==========
  1049.  
  1050.                     Steve Summit
  1051.                     scs@eskimo.com
  1052.